package com.huadao.cart_ccs.data.task;

import java.util.concurrent.ScheduledFuture;

public class CultureTankTask extends OperateTask {
    private int speed;
    private ScheduledFuture scheduledFuture;
    private int time;//秒
//    private CultureTankBO cultureTankBO;

    public CultureTankTask(int speed) {
        this.speed = speed;
    }

    public int getSpeed() {
        return speed;
    }

    public void setSpeed(int speed) {
        this.speed = speed;
    }

//    public CultureTankBO getCultureTankBO() {
//        return cultureTankBO;
//    }
//
//    public void setCultureTankBO(CultureTankBO cultureTankBO) {
//        this.cultureTankBO = cultureTankBO;
//    }


    public int getTime() {
        return time;
    }

    public void setTime(int time) {
        this.time = time;
    }

    public ScheduledFuture getScheduledFuture() {
        return scheduledFuture;
    }

    public void setScheduledFuture(ScheduledFuture scheduledFuture) {
        this.scheduledFuture = scheduledFuture;
    }

    //取消关闭任务
    public void cancelCloseTask() {
        //如果失败，就取消关闭任务
        if (scheduledFuture != null) {
//            if (!scheduledFuture.isDone()) {
//                scheduledFuture.cancel(true);
//            }
            scheduledFuture.cancel(true);
            scheduledFuture = null;
        }
    }
}
